<template>
  <div>
    <!-- 页面标题 -->
    <div id="family-file-title">
      <div style="width:200px;float:left;height:100%">
        <h1 style="margin-left:50px">家庭档案</h1>
      </div>
      <div style="float:left;height:100%;margin-left:20%">
        <el-button type="primary"
                   style="float:left;margin-top:10px"
                   @click="back"
                   round>返回</el-button>
      </div>

    </div>
    <div id="family-file-messagediv">
      <div class="family-file-messagetop">
        <i class="el-icon-document"
           style="margin-left:50px"></i>&nbsp;&nbsp;成员信息
      </div>
      <div id="family-file-messagebottom"
           v-for="(patient,index) in familyfiles"
           v-bind:key="index">
        <el-descriptions :title="patient.name"
                         direction="vertical"
                         :column="4"
                         border>
          <el-descriptions-item label="ID">{{patient.id}}</el-descriptions-item>
          <el-descriptions-item label="姓名">{{patient.name}}</el-descriptions-item>
          <el-descriptions-item label="性别">{{patient.gender}}</el-descriptions-item>
          <el-descriptions-item label="就诊人关系">{{patient.relation}}</el-descriptions-item>
          <el-descriptions-item label="身份证号码">{{patient.idno}}</el-descriptions-item>
          <el-descriptions-item label="出生日期">{{patient.birthdate}}</el-descriptions-item>
          <el-descriptions-item label="手机号">{{patient.telephone}}</el-descriptions-item>
          <el-descriptions-item label="社保卡">{{patient.socialinsurance}}</el-descriptions-item>
          <el-descriptions-item label="所在地区"
                                :span="2">{{patient.area}}</el-descriptions-item>
          <el-descriptions-item label="加入时间">{{patient.addtime}}</el-descriptions-item>
        </el-descriptions>
      </div>
    </div>
  </div>
</template>
<script>
export default {
  data () {
    return {
      familyfiles: [],
      userid: '',
    }
  },
  created () {
    //请求患者信息
    this.userid = this.$route.params.userid;
    this.$axios({
      method: 'get',
      url: '/user-management/findFamilyMembersByUid',
      params: {
        id: this.$route.params.userid
      }
    }).then(res => {
      this.familyfiles = res.data.data;
    })

  },
  methods: {
    back () {
      this.$router.back(-1);
    },
    scrollBehavior (to, from, savedPosition) {
      return { x: 0, y: 0 }
    }
  }
}
</script>
<style scoped>
* {
  /* border: 1px solid red; */
  border-radius: 3px;
}
#family-file-title {
  margin-left: 50px;
  margin-right: 50px;
  height: 60px;
}
#family-file-messagediv {
  margin-left: 50px;
  margin-right: 50px;
  margin-top: 10px;
  border: 1px solid gainsboro;
  border-radius: 3px;
  overflow: hidden;
}
.family-file-messagetop {
  width: 100%;
  height: 50px;
  background-color: #f0f0f0;
  line-height: 50px;
  font-size: 20px;
}
.el-icon-document {
  font-size: 30px;
  margin-top: 10px;
}
#family-file-messagebottom {
  font-size: 20px;
  overflow: hidden;
  margin: 10px;
}
</style>